package com.javasm.mb_store_api_final.giftsandgoods.goodsSupplier.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.javasm.mb_store_api_final.giftsandgoods.goods.entity.GgGoods;
import com.javasm.mb_store_api_final.giftsandgoods.goodsSupplier.entity.GgSupplier;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import javax.annotation.Resource;
import java.util.List;

/**
 * 商品管理-供应商(GgSupplier)表数据库访问层
 *
 * @author makejava
 * @since 2024-07-30 15:33:36
 */
public interface GgSupplierDao extends BaseMapper<GgSupplier> {
    @Select("SELECT g.*\n" +
            "FROM gg_supplier_goods sg\n" +
            "JOIN gg_goods g ON sg.gid = g.id\n" +
            "WHERE sg.sid = #{sid}")
    List<GgGoods> selectGoodsBySid(Integer sid);

    @Insert("INSERT INTO gg_supplier_goods (sid, gid) VALUES (#{id}, #{parseInt})")
    Boolean addGoodsByIdAndListGid(@Param("id") Integer id,@Param("parseInt") int parseInt);
}

